<div class="detailCustomer_block1">
    <table align="center" border="1" cellpadding="1" cellspacing="0">
        <tr>
            <th scope="col">ID</th>
            <td><?php echo $aCustomerRow['customerId']; ?></td>
        </tr>
        <tr>
            <th scope="col">Tên khách hàng</th>
            <td><a href="<?php echo func::makeUrl('customer', 'update', $aCustomerRow['customerId']); ?>"><?php echo $aCustomerRow['name']; ?></a></td>
        </tr>
        <tr>
            <th scope="col">Địa chỉ</th>
            <td><?php echo $aCustomerRow['address']; ?></td>
        </tr>
        <tr>
            <th scope="col">Điện thoại</th>
            <td><?php echo $aCustomerRow['homephone']; ?></td>
        </tr>
        <tr>
            <th scope="col">Di động</th>
            <td><?php echo $aCustomerRow['cellphone']; ?></td>
        </tr>
        <tr>
            <th scope="col">Email</th>
            <td><?php echo $aCustomerRow['email']; ?></td>
        </tr>
        <tr>
            <th scope="col">Nợ</th>
            <td><?php echo func::numberFormat($aDebitRow['amount']); ?></td>
        </tr>
    </table>
</div>
<div class="detailCustomer_block2">
    <table align="center" border="1" cellpadding="1" cellspacing="0">
    <tr>
        <th scope="row">ID</th>
        <th scope="row">Tổng tiền</th>
        <th scope="row">Giao hàng</th>
        <th scope="row">Ngày giao hàng</th>
        <th scope="row">Xóa</th>
    </tr>
    <?php
    while($aOrderRow = mysql::fetchSql($aOrderResult)){
    ?>
    <tr>
        <td><a href="<?php echo func::makeUrl('order', 'update', $aOrderRow['orderId']); ?>"><?php echo $aOrderRow['orderId']; ?></a></td>
        <td><?php echo func::numberFormat($aOrderRow['total']); ?></td>
        <td>
            <?php
                if($aOrderRow['delivered'])
                    echo 'Rồi';
                else
                    echo 'Chưa';
            ?>
        </td>
        <td><?php echo func::getDate($aOrderRow['date']); ?></td>
        <td><a href="<?php echo func::makeUrl('order', 'delete', $aOrderRow['orderId']); ?>">Xóa</a></td>
    </tr>
    <?php
    }
    ?>
    <tr>
        <td colspan="7" align="right"><a href="<?php echo  func::makeUrl('order', 'add'); ?>">Thêm đơn hàng</a></td>
    </tr>
    </table>
</div>
<div class="detailCustomer_block3">
    <table align="center" border="1" cellpadding="1" cellspacing="0">
        <tr>
            <th scope="row">ID</th>
            <th scope="row">ID đơn hàng</th>
            <th scope="row">Số tiền</th>
            <th scope="row">Ngày</th>
            <th scope="row">Xóa</th>
        </tr>
    <?php
    while($aPaymentRow = mysql::fetchSql($aPaymentResult)){
    ?>
        <tr>
            <td><a href="<?php echo func::makeUrl('payment', 'update', $aPaymentRow['paymentId']); ?>"><?php echo $aPaymentRow['paymentId']; ?></a></td>
            <td><a href="<?php echo func::makeUrl('order', 'update', $aPaymentRow['orderId']); ?>"><?php echo $aPaymentRow['orderId']; ?></a></td>
            <td><?php echo func::numberFormat($aPaymentRow['amount']); ?></td>
            <td><?php echo func::getDate($aPaymentRow['date']); ?></td>
            <td><a href="<?php echo func::makeUrl('payment', 'delete', $aPaymentRow['paymentId']); ?>">Xóa</a></td>
        </tr>
    <?php
    }
    $aResult->free();
    ?>
        <tr>
            <td colspan="7" align="right"><a href="<?php echo func::makeUrl('payment', 'add'); ?>">Thêm thanh toán</a></td>
        </tr>
    </table>
</div>